{% load emojificate package_tags %}

{% for item in items %}
    <tr>
        <td>{# item.weight / max_weight * 100 | number:0 #}{{ item.weight_percent }}%</td>
        <td>
            <a href="{{ item.absolute_url }}">{{ item.title|emojify|emojificate }}</a>
        </td>
        <td>
            {% if item.item_type == "grid" %}
                <strong>Grid:</strong>
            {% endif %}
            {{ item.description|emojify|emojificate }}
        </td>
        <td>
            {% if item.item_type == "package" %}
                {{ item.last_released|date }}
            {% elif item.item_type == "grid" %}
                N/A
            {% endif %}
        </td>
        <td>
            {% if item.item_type == "package" %}
                {{ item.repo_forks }}
            {% elif item.item_type == "grid" %}
                N/A
            {% endif %}
        </td>
        <td>
            {% if item.item_type == "package" %}
                {{ item.repo_watchers }}
            {% elif item.item_type == "grid" %}
                N/A
            {% endif %}
        </td>
        {% flag "enabled_packages_score_values" %}
            <td data-testid="search-results-{{ item.slug }}-score-cell">
                {% if item.item_type == "package" %}
                    {{ item.score }}
                {% elif item.item_type == "grid" %}
                    N/A
                {% endif %}
            </td>
        {% endflag %}
    </tr>
{% endfor %}
